package helpdesk;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class CenteredDialog extends javax.swing.JDialog {

    public CenteredDialog() {
        addWindowListener(new WindowAdapter() {
        });

        Toolkit tk = Toolkit.getDefaultToolkit();
        Dimension screenSize = tk.getScreenSize();
        int screenHeight = screenSize.height;
        int screenWidth = screenSize.width;
        setSize(screenWidth / 2, screenHeight / 2);
        setLocation(screenWidth / 4, screenHeight / 4);
        setModalityType(java.awt.Dialog.ModalityType.APPLICATION_MODAL);
    }
}